package vip.mall.common.aop;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * @author ASUS
 * @Date 2025/2/12 16:38
 * @Descripition 通用Aop日志打印
 */
@Aspect
@Component
@Slf4j
public class CommonAopLog {
    @Pointcut("execution(* vip.mall.modular.*.controller..*.*(..))")
    public void pointcut() {
    }
    @Around("pointcut()")
    public Object around(ProceedingJoinPoint pjp) throws Throwable {
        log.info("正在请求{}下的{}接口",pjp.getSignature().getDeclaringTypeName(),pjp.getSignature().getName());
        Object proceed = pjp.proceed();
        log.info("接口请求完成");
        return  proceed;
    }
}
